home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 21
/
Cream of the Crop 21 (Terry Blount) (October 1996).iso
/
os2
/
vsoup11.zip
/
socket.hh
< prev
next >
Wrap
Text File
|
1996-09-02
|
1KB
|
54 lines
// $Id: socket.hh 1.7 1996/09/02 13:30:36 hardy Exp $
//
// This progam/module was written by Hardy Griech based on ideas and
// pieces of code from Chin Huang (cthuang@io.org). Bug reports should
// be submitted to rgriech@ibm.net.
//
// This file is part of soup++ for OS/2. Soup++ including this file
// is freeware. There is no warranty of any kind implied. The terms
// of the GNU Gernal Public Licence are valid for this piece of software.
//
#ifndef __SOCKET_HH__
#define __SOCKET_HH__
class TSocket {
public:
enum TState {init,connecting,connected,closed};
private:
TState State;
int sock;
unsigned char *Buffer;
int BuffSize;
int BuffEnd;
int BuffNdx;
const char *ipAdr;
const char *service;
const char *protocol;
int send( void *src, int len );
int nextchar( void );
public:
TSocket( void );
TSocket( const TSocket &right ); // copy constructor not allowed !
~TSocket();
operator = (const TSocket &right); // assignment operator not allowed !
void close( void );
int open( const char *ipAdr, const char *service, const char *protocol,
int buffSize=4096 );
int puts( const char *s );
int printf( const char *fmt, ... );
char *gets( char *buff, int bufflen );
TState state( void ) { return State; }
const char *getIpAdr( void ) { return ipAdr; }
};
#endif